import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;

import lejos.nxt.comm.BTConnection;

public class BTserver extends Thread {

	   DataInputStream istream;
	   DataOutputStream ostream;
	   private int dir;	   

	   public  BTserver(BTConnection conn) 
	   {
		   ostream = conn.openDataOutputStream();
		   istream = conn.openDataInputStream();		
	   }
	
	   public int getDir() { return dir;}
		   
	   public void sendCommand(double x, double y, double o)
	   {
		   try {
			ostream.writeBytes("" + x + ":" + y + ":" + o + "\n");
			ostream.flush();
		} catch (IOException e) {
			// TODO Auto-generated catch block			
		}		   
	   }
	
	   
	 public void run()
	   {
	   
	
	         while (true) {
	            try {
	            
	            	
	   		//	   Thread.yield();
	   			   
	             //  try {Thread.sleep(1000);} catch (InterruptedException e) {}
	               //if (dir == -1) break;
	            } catch (Exception e) {}
	         }
	  
	   }
	
	
	
}
